package dazuoye.管道过滤器风格;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public interface PipeLine {
    static final List<String> list=new ArrayList<>();
    static final List<String> res=new ArrayList<>();
    static final int n=0;
    int getOrder();
    void execute() throws Exception;
    default void begin() throws Exception {
        List<PipeLine> pipeLines=new ArrayList<>();
        Collections.addAll(pipeLines,new CircularShifts(),new OrderAndOutput(),new InputOperation());
        Collections.sort(pipeLines, Comparator.comparingInt(PipeLine::getOrder));
        for(PipeLine p:pipeLines){
            p.execute();
        }
    }

}
